;$(document).ready(function(){
	$('input').bind('input propertychange', function() {  
	   	var length=$('input').length;
	   	for(var i=0;i<length;i++){
	   		if(($('input').eq(i).val()=="")||$(".time").html()=="请选择入住时间"){
	   			$(".searchBtn button").addClass("btn-disable");
	   			break;
	   			return false;
	   		}
	   		
	   		$(".searchBtn button").removeClass("btn-disable");
	   	}
	});
	mui("body").on("tap",".searchBtn button",function(){
		if($(this).hasClass("btn-disable")){
			return false;
		}
		$("input").blur();
		var that=$(this);
		var exp1=/^\d+(?:\.\d{1,2})?$/;
		var exp2 = /^1\d{10}$/;
		if(!exp1.test($("input").eq(3).val())){
			mui.alert("收款金额不合法"," ","关闭",function(){},"div");
			return false;
		}else if(!exp2.test($("input").eq(1).val())){
			mui.alert("手机号码不合法"," ","关闭",function(){},"div");
			return false;
		}
		if(!that.hasClass("btn-disable")){
			var data={
				price:($("input").eq(3).val()*1).toFixed(2),
				BookingName:$("input").eq(0).val(),
				BookingPhone:$("input").eq(1).val(),
				BookingTime:$(".time").html(),
				remarks:$("input").eq(2).val(),
				token:localStorage.getItem("token")
			}
			mui.openWindow({
				url:"sendMessage.html",
				id:"sendMessage.html",
				extras:{
					data:data
				}
			})
		}
	})
});
